<?php
global_config::get_instance()->add_server_class("ArrayOfSoapCluster","soap_array_of_soap_cluster");
require_once(dirname(__FILE__)."/soap_array_base.class.php"); 
class soap_array_of_soap_cluster extends soap_array_base
{ 
   public $SoapCluster = array();
   
	public  function add($item)
	{
		parent::add($this->SoapCluster, $item);
	}
	
	public function as_array()
	{
		return parent::as_array($this->SoapCluster);
	}
	
	public function save_to_db($clusterisation_result_id)
	{
		foreach ($this->as_array() as $cluster){
			$clusters_array[] = $cluster->save_to_db($clusterisation_result_id);		
		}
		
		foreach ($clusters_array as $cluster_id){
			$clusterisation_result_cluster = new clusterisation_result_cluster();
			$clusterisation_result_cluster->clusterisation_result_cluster_id->set_value($cluster_id);
			$clusterisation_result_cluster->clusterisation_result_id->set_value($clusterisation_result_id);
			$dba = db_adapter::get_instance();
			$dba->save($clusterisation_result_cluster);
		}
	}
}
?>
